export function parser(tokens) {
  const result = [];
  let last = null;
  let left = null;
  let plusToken = null;
  for (const token of tokens) {
    if (plusToken) {
      const right = token;
      result.push({
        type: "BinaryExpression",
        left,
        right,
      });
    }

    if (token.type === "PlusToken") {
      left = last;
      plusToken = token;
    }

    last = token;
  }

  return result;
}
